\(\int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx\) [54]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 42 \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=-\frac {\cot (a+b x)}{2 b}-\frac {\cot ^3(a+b x)}{12 b}+\frac {\tan (a+b x)}{4 b} \]

[Out]

-1/2*cot(b*x+a)/b-1/12*cot(b*x+a)^3/b+1/4*tan(b*x+a)/b

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4373, 2700, 276} \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=\frac {\tan (a+b x)}{4 b}-\frac {\cot ^3(a+b x)}{12 b}-\frac {\cot (a+b x)}{2 b} \]

[In]

Int[Csc[a + b*x]^2*Csc[2*a + 2*b*x]^2,x]

[Out]

-1/2*Cot[a + b*x]/b - Cot[a + b*x]^3/(12*b) + Tan[a + b*x]/(4*b)

Rule 276

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2700

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(1 + x^2)^((
m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]

Rule 4373

Int[((f_.)*sin[(a_.) + (b_.)*(x_)])^(n_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/f^p, Int[Cos[a
+ b*x]^p*(f*Sin[a + b*x])^(n + p), x], x] /; FreeQ[{a, b, c, d, f, n}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} \int \csc ^4(a+b x) \sec ^2(a+b x) \, dx \\ & = \frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^4} \, dx,x,\tan (a+b x)\right )}{4 b} \\ & = \frac {\text {Subst}\left (\int \left (1+\frac {1}{x^4}+\frac {2}{x^2}\right ) \, dx,x,\tan (a+b x)\right )}{4 b} \\ & = -\frac {\cot (a+b x)}{2 b}-\frac {\cot ^3(a+b x)}{12 b}+\frac {\tan (a+b x)}{4 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.14 \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=-\frac {5 \cot (a+b x)}{12 b}-\frac {\cot (a+b x) \csc ^2(a+b x)}{12 b}+\frac {\tan (a+b x)}{4 b} \]

[In]

Integrate[Csc[a + b*x]^2*Csc[2*a + 2*b*x]^2,x]

[Out]

(-5*Cot[a + b*x])/(12*b) - (Cot[a + b*x]*Csc[a + b*x]^2)/(12*b) + Tan[a + b*x]/(4*b)

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.79 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.10

method result size
risch \(\frac {4 i \left (2 \,{\mathrm e}^{2 i \left (x b +a \right )}-1\right )}{3 b \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )^{3} \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}\) \(46\)
default \(\frac {-\frac {1}{3 \cos \left (x b +a \right ) \sin \left (x b +a \right )^{3}}+\frac {4}{3 \sin \left (x b +a \right ) \cos \left (x b +a \right )}-\frac {8 \cot \left (x b +a \right )}{3}}{4 b}\) \(51\)

[In]

int(csc(b*x+a)^2*csc(2*b*x+2*a)^2,x,method=_RETURNVERBOSE)

[Out]

4/3*I*(2*exp(2*I*(b*x+a))-1)/b/(exp(2*I*(b*x+a))-1)^3/(exp(2*I*(b*x+a))+1)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.29 \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=-\frac {8 \, \cos \left (b x + a\right )^{4} - 12 \, \cos \left (b x + a\right )^{2} + 3}{12 \, {\left (b \cos \left (b x + a\right )^{3} - b \cos \left (b x + a\right )\right )} \sin \left (b x + a\right )} \]

[In]

integrate(csc(b*x+a)^2*csc(2*b*x+2*a)^2,x, algorithm="fricas")

[Out]

-1/12*(8*cos(b*x + a)^4 - 12*cos(b*x + a)^2 + 3)/((b*cos(b*x + a)^3 - b*cos(b*x + a))*sin(b*x + a))

Sympy [F]

\[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=\int \csc ^{2}{\left (a + b x \right )} \csc ^{2}{\left (2 a + 2 b x \right )}\, dx \]

[In]

integrate(csc(b*x+a)**2*csc(2*b*x+2*a)**2,x)

[Out]

Integral(csc(a + b*x)**2*csc(2*a + 2*b*x)**2, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 308 vs. \(2 (36) = 72\).

Time = 0.31 (sec) , antiderivative size = 308, normalized size of antiderivative = 7.33 \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=\frac {4 \, {\left ({\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \sin \left (8 \, b x + 8 \, a\right ) - 2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \sin \left (6 \, b x + 6 \, a\right ) - 2 \, \cos \left (8 \, b x + 8 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) + 4 \, \cos \left (6 \, b x + 6 \, a\right ) \sin \left (2 \, b x + 2 \, a\right )\right )}}{3 \, {\left (b \cos \left (8 \, b x + 8 \, a\right )^{2} + 4 \, b \cos \left (6 \, b x + 6 \, a\right )^{2} + 4 \, b \cos \left (2 \, b x + 2 \, a\right )^{2} + b \sin \left (8 \, b x + 8 \, a\right )^{2} + 4 \, b \sin \left (6 \, b x + 6 \, a\right )^{2} - 8 \, b \sin \left (6 \, b x + 6 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) + 4 \, b \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, {\left (2 \, b \cos \left (6 \, b x + 6 \, a\right ) - 2 \, b \cos \left (2 \, b x + 2 \, a\right ) + b\right )} \cos \left (8 \, b x + 8 \, a\right ) - 4 \, {\left (2 \, b \cos \left (2 \, b x + 2 \, a\right ) - b\right )} \cos \left (6 \, b x + 6 \, a\right ) - 4 \, b \cos \left (2 \, b x + 2 \, a\right ) - 4 \, {\left (b \sin \left (6 \, b x + 6 \, a\right ) - b \sin \left (2 \, b x + 2 \, a\right )\right )} \sin \left (8 \, b x + 8 \, a\right ) + b\right )}} \]

[In]

integrate(csc(b*x+a)^2*csc(2*b*x+2*a)^2,x, algorithm="maxima")

[Out]

4/3*((2*cos(2*b*x + 2*a) - 1)*sin(8*b*x + 8*a) - 2*(2*cos(2*b*x + 2*a) - 1)*sin(6*b*x + 6*a) - 2*cos(8*b*x + 8
*a)*sin(2*b*x + 2*a) + 4*cos(6*b*x + 6*a)*sin(2*b*x + 2*a))/(b*cos(8*b*x + 8*a)^2 + 4*b*cos(6*b*x + 6*a)^2 + 4
*b*cos(2*b*x + 2*a)^2 + b*sin(8*b*x + 8*a)^2 + 4*b*sin(6*b*x + 6*a)^2 - 8*b*sin(6*b*x + 6*a)*sin(2*b*x + 2*a)
+ 4*b*sin(2*b*x + 2*a)^2 - 2*(2*b*cos(6*b*x + 6*a) - 2*b*cos(2*b*x + 2*a) + b)*cos(8*b*x + 8*a) - 4*(2*b*cos(2
*b*x + 2*a) - b)*cos(6*b*x + 6*a) - 4*b*cos(2*b*x + 2*a) - 4*(b*sin(6*b*x + 6*a) - b*sin(2*b*x + 2*a))*sin(8*b
*x + 8*a) + b)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.83 \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=-\frac {\frac {6 \, \tan \left (b x + a\right )^{2} + 1}{\tan \left (b x + a\right )^{3}} - 3 \, \tan \left (b x + a\right )}{12 \, b} \]

[In]

integrate(csc(b*x+a)^2*csc(2*b*x+2*a)^2,x, algorithm="giac")

[Out]

-1/12*((6*tan(b*x + a)^2 + 1)/tan(b*x + a)^3 - 3*tan(b*x + a))/b

Mupad [B] (verification not implemented)

Time = 19.41 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.88 \[ \int \csc ^2(a+b x) \csc ^2(2 a+2 b x) \, dx=\frac {\mathrm {tan}\left (a+b\,x\right )}{4\,b}-\frac {\frac {{\mathrm {tan}\left (a+b\,x\right )}^2}{2}+\frac {1}{12}}{b\,{\mathrm {tan}\left (a+b\,x\right )}^3} \]

[In]

int(1/(sin(a + b*x)^2*sin(2*a + 2*b*x)^2),x)

[Out]

tan(a + b*x)/(4*b) - (tan(a + b*x)^2/2 + 1/12)/(b*tan(a + b*x)^3)